<template>
  <div>
    <el-table :data="info.list" style="width: 100%" stripe border>
      <el-table-column align="center" prop="id" label="ID" width="60px"> </el-table-column>
      <el-table-column align="center" prop="contact" label="ئالاقىلىش نومۇرى" width="150px"> </el-table-column>
      <el-table-column align="center" prop="content" label="پىكىر-تەكلىپ"> </el-table-column>
      <el-table-column align="center" prop="location" label="ئادىرىسى"> </el-table-column>
      <el-table-column align="center" prop="ua" label="User-Agent"> </el-table-column>
      <el-table-column align="center" prop="systemInfo" label="سېستىما تىپى"> </el-table-column>
      <el-table-column align="center" prop="create_time" label="يوللىغان ۋاقتى">
        <template slot-scope="{row}">
          {{row.create_time ? $dayjs(row.create_time).format('YYYY-MM-DD HH:mm:ss') : ''}}
        </template>
      </el-table-column>
    </el-table>
    <el-row align="center" style="text-align:center;margin-top:20px">
      <el-pagination @current-change="handleCurrentChange" @size-change="sizeChange" background layout="total, sizes, prev, pager, next, jumper" :total="info.total" :page-size="pageSize"
        :current-page="pageNum" :page-sizes="[10, 20, 50, 100]">
      </el-pagination>
    </el-row>
  </div>
</template>

<script>
import { getFeedbackList } from '@/api/kino';
export default {
  name: 'FeedbackList',
  components: {},
  data() {
    return {
      pageSize: 20,
      pageNum: 1,
      info: {
        total: 0,
        list: []
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      getFeedbackList({
        pageSize: this.pageSize,
        pageNum: this.pageNum
      }).then(res => {
        this.info = res || { list: [] };
        //   console.log(res);
      }).catch(err=>{
          console.log(err);
      })
    },
    handleCurrentChange(pageNum) {
      this.pageNum = pageNum;
      this.getList();
    },
    sizeChange(pageSize) {
      this.pageSize = pageSize;
      this.pageNum = 1;
      this.$nextTick(() => {
        this.getList();
      })
    },
  },
};
</script>

<style scoped lang="scss">
</style>
